from abilities.base import *
import random

class Smite(Ability):
    def __init__(self,player):
        Ability.__init__(self,player)
        self.Name = "smite"
    def calculateDamage(self):
        self.Dmg = ((self.Player.Str * 0.85) + (self.Player.Int))
        self.HP += (self.Dmg * 0.25)
        if self.HP > self.MaxHP:
            self.HP = self.MaxHP
#--Needs to have a 25% chance to re-cast this spell--#		

class CrusaderStrike(Ability):
    def __init__(self,player):
        Ability.__init__(self,player)
        self.Name = "crusader strike"
    def calculateDamage(self):
        self.DoulbeCast = 25
        self.Dmg = (((random.randint(5,7) * random.randint(3,5)) + (self.Player.Str + self.Player.Int)) / 2)
        if self.DoubleCast >= random.randint(1,100):
            self.Dmg *= 0.5
        return self.Dmg
    def setCooldown(self):
        self.Cooldown=1
        
class FistOfJustice(Ability):
    def __init__(self,player):
        Ability.__init__(self,player)
        self.Name = "fist of justice"
    def calculateDamage(self,otherPlayer):
        return 0
    def setCooldown(self):
        self.Cooldown=10
    def addStun(self,otherPlayer):
        otherPlayer.stun(5)
        
class HolyWrath(Ability):
    def __init__(self,player):
        Ability.__init__(self,player)
        self.Name = "holy wrath"
    def calculateDamage(self,otherPlayer):
        self.Dmg = (random.randint(5,15) + ((self.Player.Str + self.Player.Int) / 2))
        return self.Dmg
    def setCooldown(self):
        self.Cooldown=7
    def isAOE(self):
        return True
    
class HeroesMight(Buff):
    def __init__(self,player):
        Buff.__init__(self,player)
        self.Name = "heroes might"
    def setCooldown(self):
        self.Cooldown=5
    def statChange(self,otherPlayer):
        self.PrevStr = self.Player.Str
        self.PrevAgi = self.Player.Agi
        self.PrevInt = self.Player.Int
        self.PrevDef = self.Player.Def
        self.Player.Str *= 1.1
        self.Player.Agi *= 1.1
        self.Player.Int *= 1.1
        self.Player.Def *= 1.1
        def removeStatChange(self,otherPlayer):
            self.PlayerStr = self.PrevStr
            self.PlayerAgi = self.PrevAgi
            self.PlayerInt = self.PrevInt
            self.PlayerDef = self.PrevDef
        def upfrontDamage(self,otherPlayer):
            return 0
        def setTime(self):
            return 4	